<template>
  <div class="fx-timeline-item">
    <div class="timeline-line">
      <div class="timeline-dot"></div>
      <div class="timeline-dot-line"></div>
    </div>
    <div class="fx-timeline-wrapper">
      <div class="fx-timeline-timestamp" v-if="placement==='top'">
        {{ timestamp }}
      </div>
      <div class="fx-timeline-title">
        <slot></slot>
      </div>
      <div class="fx-timeline-timestamp" v-if="placement==='bottom'">
        {{ timestamp }}
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, PropType } from 'vue'

export interface TimestampProps {
  timestamp: string | number;
  placement: 'top' | 'bottom' | 'none';
}

export default defineComponent({
  name: 'FxTimelineItem',
  props: {
    timestamp: {
      type: [String, Number] as PropType<string | number>,
      required: true
    },
    placement: {
      type: String as PropType<'top' | 'bottom' | 'none'>,
      default: 'bottom'
    }
  },
  setup () {
    return {}
  }
})
</script>
